﻿using System;
using System.Data;
using System.Data.SqlClient;
using DBModule;

namespace DataLogical
{
    public class ApplicationPresent
    {
        public static DataTable ListAllWithApplicant(int _id)
        {
            string strSQL = string.Format("SELECT * FROM vwApplicationPresent WHERE Applicant = {0} ", _id);
            SqlModule db = CommonVar.s_SqlModule;
            DataTable dt = db.QueryBySql(strSQL);
            return dt;
        }

        public static DataTable ListAllWithApprover(int _id)
        {
            string strSQL = string.Format("SELECT * FROM vwApplicationPresent WHERE Approver = {0} ", _id);
            SqlModule db = CommonVar.s_SqlModule;
            DataTable dt = db.QueryBySql(strSQL);
            return dt;
        }

        public static DataTable ListAllWithGA()
        {
            string strSQL = string.Format("SELECT * FROM vwApplicationPresent WHERE Status = '已批准' ");
            SqlModule db = CommonVar.s_SqlModule;
            DataTable dt = db.QueryBySql(strSQL);
            return dt;
        }
    }
}
